package exp4;
//数字统计：从键盘上输入若干个数，从小到大输出每一个数和他的频率
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.Vector;

public class NumberFrequency {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Vector<Integer> v = new Vector<Integer>();
        while(in.hasNext()){
            v.add(in.nextInt());
        }
        Collections.sort(v);
        System.out.println(v);

        int vget=v.get(0),temp=1;
        for (int i=0;i<v.size();i++){
            if (v.get(i) == vget) {
                temp++;
                continue;
            }
            System.out.println(vget+" "+temp);
            temp=1;
            vget=v.get(i);
        }
        if (vget == v.get(v.size()-1)) {
            System.out.println(vget + " " + temp);
        }
    }
}
